﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using EPiServer.Core;
using EPiServer.Core.Html;

namespace EPiServer.Controllers
{
    public class PageController : Controller
    {
        public ActionResult Index(PageData page)
        {
            var model = CreateModelFromPageData(page);
            return View(model);
        }

        private Models.Page CreateModelFromPageData(PageData page)
        {
            var model = new Models.Page();
            model.PageType = page.PageTypeName;
            page.PopulateModel(model);
            return model;
        }
    }
}